package com.sunshenshen.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.github.pagehelper.PageInfo;
import com.sunshenshen.bean.Student;
import com.sunshenshen.service.StudentService;

@Controller
public class StudentController {
	
	@Resource
	private StudentService studentService;
	
	@RequestMapping("list")
	public String list(Student student,Model model,@RequestParam(defaultValue = "1")Integer pageNum,@RequestParam(defaultValue = "4")Integer pageSize) {
		
		PageInfo<Student> info = studentService.list(student, pageNum, pageSize);
		model.addAttribute("info", info);
		return "list";
		
		
	}

}
